package com.adwin.addcoin.ui.dialog

import android.content.Context
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup.LayoutParams
import com.adwin.addcoin.base.BaseDialog
import com.adwin.addcoin.databinding.PrivacyPolicyDialogBinding

class PrivacyPolicyDialog(val mContext: Context): BaseDialog(mContext) {

    private val privacyMessage = "This Privacy Policy describes the policies and procedures on\n" +
            "the collection, use and disclosure of your information when\n" +
            "you use the service and tells you about your privacy rights\n" +
            "and how the law protects you.\n" +
            "Add Coin uses your personal data to provide and improve the\n" +
            "service. By using the service, You agree to the collection and\n" +
            "use of information in accordance with this Privacy Policy.\n" +
            "Definitions\n" +
            "For the purposes of this Privacy Policy\n" +
            "1. You means the individual accessing or using the\n" +
            "service, or the company, or other legal entity on behalf\n" +
            "Si\n" +
            "ndividualis\n" +
            "service, as applicable.\n" +
            "2. Company (referred to as either \"the Company”,\"We\n" +
            "\"Us\" or\"Our\" in this Agreement) refers to \"Add Coin\n" +
            "App\"\n" +
            "3.Account means a unique account created for you to\n" +
            "access our service or parts of our service.\n" +
            "4. Service Provider means any natural or legal person\n" +
            "who processes the data on behalf of the Company. lt\n" +
            "refers to third-party companies or individuals\n" +
            "employed by the Company to facilitate the service, to\n" +
            "provide the service on behalf of the Company, to\n" +
            "perform services related to the service or to assist the\n" +
            "Company in analyzing how the service is used.\n" +
            "5. Third-party Social Media Service refers to any website\n" +
            "or any socialnetwork website through which a user\n" +
            "can log in or create an account to use the service.\n" +
            "6.Personal Data is any information that relates to an\n" +
            "identified or identifiable individual.\n" +
            "7. Cookies are small files that are placed on your\n" +
            "computer, mobile device or any other device by a\n" +
            "website, containing the details of your browsing\n" +
            "history on that website among its many uses.\n" +
            "8. Device means any device that can access the service\n" +
            "such as a computer, a cellphone or a digital tablet.\n" +
            "9. Usage Data refers to data collected automatically\n" +
            "service infrastructure itself (for example, the duration\n" +
            "of a page visit).\n" +
            "Collecting and Using Your Personal Data\n" +
            "Types of Data Collected\n" +
            "Personal Data\n" +
            "While using the service, we may ask you to provide us with\n" +
            "certain personally identifiable information that can be used to\n" +
            "contact or identify you. Personally identifiable information\n" +
            "may include, but is not limited to:\n" +
            "1.Email address\n" +
            "2.First name and last name\n" +
            "3.Phone number\n" +
            "4. Usage Data\n" +
            "Usage Data\n" +
            "Usage Data is collected automatically when using the\n" +
            "service.\n" +
            "Usage Data may include information such as your device's\n" +
            "Internet Protocol address (e.g.IP address), browser type,\n" +
            "browser version, the pages of the service that you visit, the\n" +
            "time and date of your visit, the time spent on those pages,\n" +
            "unique device identifiers and other diagnostic data.\n" +
            "When you access the service by or through a mobile device,\n" +
            "Tap Coin may collect certain information automatically,\n" +
            "including, but not limited to, the type of mobile device you\n" +
            "use, your mobile device unique ID, the lP address of your\n" +
            "mobile device, your mobile operating system, the type of\n" +
            "mobile Internet browser you use, unique device identifiers\n" +
            "and other diagnostic data.\n" +
            "Tap Coin may also collect information that your browser\n" +
            "sends whenever you visit our service or when you access the\n" +
            "service by or through a mobile device.\n" +
            "Tracking Technologies and Cookies\n" +
            "Tap Coin use cookies and similar tracking technologies to\n" +
            "track the activity on the service and store certain information.\n" +
            "Tracking technologies used are beacons, tags, and scripts to\n" +
            "collect and track information and to improve and analyze the\n" +
            "service.\n" +
            "You can instruct your browser to refuse all cookies or to\n" +
            "indicate when a cookie is being sent. However, if you do not\n" +
            "0\n" +
            "service.\n" +
            "Cookies can be persistent or session cookies.Persistent\n" +
            "cookies remain on your personal computer or mobile device\n" +
            "when you go offline, while session cookies are deleted as\n" +
            "soon as you close your web browser.\n" +
            "Add Coin use both session and persistent cookies. Cookies\n" +
            "are essential to provide you with services available through\n" +
            "the website and to enable you to use some of its features.\n" +
            "They help to authenticate users and prevent fraudulent use of\n" +
            "user accounts.Without these cookies, the services that you\n" +
            "have asked for cannot be provided, and Add Coin only use\n" +
            "these cookies to provide you with those services\n" +
            "Use of Your Personal Data\n" +
            "The Company may use Personal Data for the following\n" +
            "purposes:\n" +
            "1. To provide and maintain the service, including to\n" +
            "monitor the usage of our service.\n" +
            "2. To manage your account: to manage your registration\n" +
            "as a user of the service. The Personal Data you\n" +
            "provide can give you access to different\n" +
            "functionalities of the service that are available to you\n" +
            "as a registered user.\n" +
            "3. For the performance of a contract: the development,\n" +
            "compliance and undertaking of the purchase contract\n" +
            "for the products, items or services you have\n" +
            "purchased or of any other contract with Add Coin\n" +
            "through the service.\n" +
            "4. To contact you: To contact you by email, telephone\n" +
            "calls, SMS, or other equivalent forms of electronic\n" +
            "communication, such as a mobile application's push\n" +
            "notifications regarding updates or informative\n" +
            "communications related to the functionalities\n" +
            "products or contracted services, including the\n" +
            "security updates, when necessary or reasonable for\n" +
            "their implementation.\n" +
            "5. To provide you with news, special offers and genera\n" +
            "information about other goods, services and events\n" +
            "which we offer that are similar to those that you have\n" +
            "already purchased or enquired about unless you have\n" +
            "opted not to receive such information.\n" +
            "6. To attend and manage your requests.\n" +
            "We may share your personal information in the following\n" +
            "situations:\n" +
            "1.With service providers: We may share your persona\n" +
            "information with service providers to monitor and\n" +
            "analyze the use of our service, to contact you.\n" +
            "2.For Business transfers: We may share or transfer your\n" +
            "personalinformation in connection with, or during\n" +
            "negotiations of, any merger, sale of Company assets,\n" +
            "financing, or acquisition of all or a portion of our\n" +
            "business to another company\n" +
            "3. With Affiliates: We may share your information with\n" +
            "the affiliates.Affiliates include our parent company\n" +
            "and any other subsidiaries, joint venture partners or\n" +
            "other companies that we control or that are in\n" +
            "business relation with us\n" +
            "4.With Business partners: We may share your\n" +
            "information with our business partners.\n" +
            "5.With other users: when you share personal\n" +
            "information or otherwise interact in the public areas\n" +
            "with other users, such information may be viewed by\n" +
            "all users and may be publicly distributed outside.lf\n" +
            "you interact with other users or register through a\n" +
            "Third-Party Social Media Service, your contacts on the\n" +
            "Third-Party Social Media Service may see your name\n" +
            "profile, pictures and description of your activity.\n" +
            "Similarly, other users will be able to view descriptions\n" +
            "of your activity, communicate with you and view your\n" +
            "profile.\n" +
            "Retention of Your Personal Data\n" +
            "The Company will retain your personal Data only for as long\n" +
            "as is necessary for the purposes set out in this Privacy Policy.\n" +
            "We will retain and use your Personal Data to the extent\n" +
            "necessary to comply with our legal obligations (for example\n" +
            "if we are required to retain your data to comply with\n" +
            "applicable laws),resolve disputes, and enforce our legal\n" +
            "agreements and policies.\n" +
            "The Company will also retain Usage Data for internal analysis\n" +
            "purposes.Usage Data is generally retained for a shorter\n" +
            "period of time, except when this data is used to strengthen\n" +
            "the security or to improve the functionality of the service, or\n" +
            "we are legally obligated to retain this data for longer time\n" +
            "periods.\n" +
            "Transfer of Your Personal Data\n" +
            "Your information,including Personal Data, is processed at the\n" +
            "Company's operating offices and in any other places where\n" +
            "the parties involved in the processing are located.lt means\n" +
            "that this information may be transferred to - and maintained\n" +
            "on - computers located outside of your state, province,\n" +
            "country or other governmental jurisdiction where the data\n" +
            "protection laws may differ than those from your jurisdiction.\n" +
            "submission of such information represents your agreement\n" +
            "to that transfer.\n" +
            "The Company will take all steps reasonably necessary to\n" +
            "ensure that your data is treated securely and in accordance\n" +
            "with this Privacy Policy and no transfer of your Personal Data\n" +
            "will take place to an organization or a country unless there\n" +
            "are adequate controls in place including the security of your\n" +
            "data and other personalinformation.\n" +
            "Disclosure of Your Personal Data\n" +
            "Business Transactions\n" +
            "lf the Company is involved in a merger, acquisition or asset\n" +
            "sale, your Personal Data may be transferred. We will provide\n" +
            "notice before your Personal Data is transferred and becomes\n" +
            "subject to a different Privacy Policy.\n" +
            "Law enforcement\n" +
            "Under certain circumstances, the Company may be required\n" +
            "to disclose your Personal Data if required to do so by law or\n" +
            "in response to valid requests by public authorities (e.g.a\n" +
            "court or a government agency)\n" +
            "Other legal requirements\n" +
            "The Company may disclose your Personal Data in the good\n" +
            "faith belief that such action is necessary to.\n" +
            "1. Comply with a legal obligation\n" +
            "2. Protect and defend the rights or property of the\n" +
            "Company\n" +
            "3. Prevent or investigate possible wrongdoing in\n" +
            "connection with the service\n" +
            "4. Protect the personal safety of users of the service or\n" +
            "the public\n" +
            "5. Protect against legal liability\n" +
            "Security of Your Personal Data\n" +
            "The security of Your Personal Data is important but\n" +
            "remember that no method of transmission over the Internet.\n" +
            "or method of electronic storage is 100% secure. While Tap\n" +
            "Coin strives to use commercially acceptable means to\n" +
            "protect your Personal Data, we cannot guarantee its absolute security.\n" +
            "Children's Privacy\n" +
            "Our Service does not address anyone under the age of 13.Wedo not knowingly collect personally identifiable informationfrom anyone under the age of 13.If You are a parent orguardian and you are aware that your child has provided TapCoin with Personal Data, please contact us.If Tap Coinbecomes aware that we have collected Personal Data fromanyone under the age of 13 without verification of parentalconsent, we take steps to remove that information from theservers.\n" +
            "if we need to rely on consent as alegal basis for processingyour information and your country requires consent from aparent, we may require your parent's consent before wecollect and use that information.\n" +
            "Links to Other Websites\n" +
            "Our Service may contain links to other websites that are notoperated by us.lf you click on a third party link, you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every site you visit.\n" +
            "We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sitesor services.\n" +
            "Changes to this Privacy Policy\n" +
            "We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.\n" +
            "We will let you know via email and/or a prominent notice on the service, prior to the change becoming effective and updating the \"Last updated\" date at the top of this PrivacyPolicy.\n" +
            "You are advised to review this Privacy Policy periodically for any changes.Changes to this Privacy Policy are effective when they are posted on this page.\n" +
            "ContactUs\n" +
            "If you have any questions about this Privacy Policy, you can contact us:"

    lateinit var binding:PrivacyPolicyDialogBinding

    override fun getGravity(): Int = Gravity.CENTER

    override fun getWidth(): Int = LayoutParams.MATCH_PARENT

    override fun getHeight(): Int = LayoutParams.MATCH_PARENT

    override fun initLayout(): View {
        binding = PrivacyPolicyDialogBinding.inflate(LayoutInflater.from(mContext))
        return binding.root
    }

    override fun initData() {
        binding.tvUserAgreementMessage.text = privacyMessage
       binding.ivReturnIcon.setOnClickListener {
           dismiss()
       }
    }
}